<?php
defined('BASEPATH') or exit('No direct script access allowed');

if (! function_exists('getRedis')) {

    function getRedis($group)
    {
        $CI = & get_instance();
        $CI->load->config('redis', true);
        $config = $CI->config->item($group, 'redis');
        $redis = new Redis();
        $result = $redis->connect($config['host'], $config['port']);
        return $result ? $redis : false;
    }
}